<template>
  <div class="child">
    <ul>
      <li v-for="(item,index) in $store.state.singerList"></li>
    </ul>
  </div>
</template>

<script>
import { mapState } from 'core-js/core/array';
import { mapState } from 'vuex'
  export default {
    props: ["fromFather"],
    name:"Child",
    data(){
      return{

      }
    },
    computed:{
      ...mapState(['singerList']),
      //对象写法：属性名是命令计算属性名 右侧是state中的数据名
      // ...mapState([{list:'singerList'}])
    },
    methods: {
      fn(){
        this.$store.commit('addSingerList',this.singer)
      }
    }
}
</script>

<style lang="less" scoped>
</style>
